import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getwidget_demo/app/routes/app_pages.dart';

import '../controllers/home_controller.dart';

class HomeView extends GetView<HomeController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('GetWidget 效果演示'),
        centerTitle: true,
      ),
      body: Container(
        child: GridView(
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2, // 指定列数
            mainAxisSpacing: 20, // 主轴方向的间距
            crossAxisSpacing: 10, // 交叉轴的间距
            childAspectRatio: 5.0, // 子组件的宽高比例
          ),
          children: [
            ListTile(
              title: Text('01-按钮'),
              subtitle: Text('GFButton'),
              onTap: () {
                Get.toNamed(Routes.GFBUTTON);
              },
            ),
            ListTile(
              title: Text('02-徽章'),
              subtitle: Text('GFBadge'),
              onTap: () {
                Get.toNamed(Routes.GFBADGE);
              },
            ),
            ListTile(
              title: Text('03-头像'),
              subtitle: Text('GFAvatar'),
              onTap: () {
                Get.toNamed(Routes.GFAVATAR);
              },
            ),
            ListTile(
              title: Text('04-图片'),
              subtitle: Text('GFImage'),
              onTap: () {
                Get.toNamed(Routes.GFIMAGE);
              },
            ),
            ListTile(
              title: Text('05-卡片'),
              subtitle: Text('GFCard'),
              onTap: () {
                Get.toNamed(Routes.GFCARD);
              },
            ),
            ListTile(
              title: Text('06-轮播图'),
              subtitle: Text('GFCarousel'),
              onTap: () {
                Get.toNamed(Routes.GFCAROUSEL);
              },
            ),
            ListTile(
              title: Text('07-瓦片'),
              subtitle: Text('GFTile'),
              onTap: () {
                Get.toNamed(Routes.GFTILE);
              },
            ),
            ListTile(
              title: Text('08-选项卡'),
              subtitle: Text('GFTab'),
              onTap: () {
                Get.toNamed(Routes.GFTAB);
              },
            ),
            ListTile(
              title: Text('09-提示框'),
              subtitle: Text('GFToast'),
              onTap: () {
                Get.toNamed(Routes.GFTOAST);
              },
            ),
            ListTile(
              title: Text('10-切换'),
              subtitle: Text('GFToggle'),
              onTap: () {
                Get.toNamed(Routes.GFTOGGLE);
              },
            ),
            ListTile(
              title: Text('11-排版'),
              subtitle: Text('GFTypography'),
              onTap: () {
                Get.toNamed(Routes.GFTYPOGRAPHY);
              },
            ),
            ListTile(
              title: Text('12-抽屉菜单'),
              subtitle: Text('GFDrawer'),
              onTap: () {
                Get.toNamed(Routes.GFDRAWER);
              },
            ),
            ListTile(
              title: Text('13-手风琴'),
              subtitle: Text('GFAccordion'),
              onTap: () {
                Get.toNamed(Routes.GFACCORDION);
              },
            ),
            ListTile(
              title: Text('14-警告框'),
              subtitle: Text('GFAlert'),
              onTap: () {
                Get.toNamed(Routes.GFALERT);
              },
            ),
            ListTile(
              title: Text('15-应用头'),
              subtitle: Text('GFAppbar'),
              onTap: () {
                Get.toNamed(Routes.GFAPPBAR);
              },
            ),
            ListTile(
              title: Text('16-搜索框'),
              subtitle: Text('GFSearchBar'),
              onTap: () {
                Get.toNamed(Routes.GFSEARCHBAR);
              },
            ),
            ListTile(
              title: Text('17-五星评价'),
              subtitle: Text('GFRating'),
              onTap: () {
                Get.toNamed(Routes.GFRATING);
              },
            ),
            ListTile(
              title: Text('18-下拉框'),
              subtitle: Text('GFDropdown'),
              onTap: () {
                Get.toNamed(Routes.GFDROPDOWN);
              },
            ),
            ListTile(
              title: Text('19-加载器'),
              subtitle: Text('GFLoader'),
              onTap: () {
                Get.toNamed(Routes.GFLOADER);
              },
            ),
            ListTile(
              title: Text('20-进度条'),
              subtitle: Text('GFProgressBar'),
              onTap: () {
                Get.toNamed(Routes.GFPROGRESSBAR);
              },
            ),
            ListTile(
              title: Text('21-骨架屏'),
              subtitle: Text('GFShimmer'),
              onTap: () {
                Get.toNamed(Routes.GFSHIMMER);
              },
            ),
            ListTile(
              title: Text('22-动画'),
              subtitle: Text('GFAnimation'),
              onTap: () {
                Get.toNamed(Routes.GFANIMATION);
              },
            ),
            ListTile(
              title: Text('23-边框'),
              subtitle: Text('GFBorder'),
              onTap: () {
                Get.toNamed(Routes.GFBORDER);
              },
            ),
            ListTile(
              title: Text('24-底部弹窗'),
              subtitle: Text('GFBottomSheet'),
              onTap: () {
                Get.toNamed(Routes.GFBOTTOMSHEET);
              },
            ),
            ListTile(
              title: Text('25-复选框'),
              subtitle: Text('GFCheckbox'),
              onTap: () {
                Get.toNamed(Routes.GFCHECKBOX);
              },
            ),
            ListTile(
              title: Text('26-复选框列表'),
              subtitle: Text('GFCheckBoxListTile'),
              onTap: () {
                Get.toNamed(Routes.GFCHECKBOXLISTTILE);
              },
            ),
            ListTile(
              title: Text('27-多选框'),
              subtitle: Text('GFMultiSelect'),
              onTap: () {
                Get.toNamed(Routes.GFMULTISELECT);
              },
            ),
            ListTile(
              title: Text('28-欢迎界面'),
              subtitle: Text('GFIntroscreen'),
              onTap: () {
                Get.toNamed(Routes.GFINTROSCREEN);
              },
            ),
            ListTile(
              title: Text('29-单选框'),
              subtitle: Text('GFRadio'),
              onTap: () {
                Get.toNamed(Routes.GFRADIO);
              },
            ),
            ListTile(
              title: Text('30-单选框列表'),
              subtitle: Text('GFRadioListTile'),
              onTap: () {
                Get.toNamed(Routes.GFRADIOLISTTILE);
              },
            ),
            ListTile(
              title: Text('31-吸顶头部1'),
              subtitle: Text('GFStickyHeader'),
              onTap: () {
                Get.toNamed(Routes.GFSTICKYHEADER);
              },
            ),
            ListTile(
              title: Text('32-吸顶头部2'),
              subtitle: Text('GFStickyHeaderBuilder'),
              onTap: () {
                Get.toNamed(Routes.GFSTICKYHEADERBUILDER);
              },
            ),
          ],
        )
      ),
    );
  }
}
